<!-- 重置密码 -->
<template>
    <div class="crumbs">
    <crumbs></crumbs>
    </div>
    <el-form  label-width="100px" :model="formInline" class="demo-form-inline">
        <el-form-item label="企业用户名">
        <el-input  style="width: 300px;margin-bottom: 20px"  v-model="formInline.username" placeholder="企业用户名" />
      </el-form-item>
      <el-form-item label="企业旧密码">
        <el-input   style="width: 300px;margin-bottom: 20px"  v-model="formInline.password2" placeholder="企业密码" />
      </el-form-item>
      <el-form-item label="企业新密码">
        <el-input   style="width: 300px;margin-bottom: 20px"  v-model="formInline.password" placeholder="企业密码" />
      </el-form-item>
      <el-form-item label="企业手机号">
        <el-input  style="width: 300px;margin-bottom: 20px"  v-model="formInline.phone" placeholder="企业手机号" />
      </el-form-item>
    </el-form>
    <el-button @click="confirm">确认</el-button>
    <el-button @click="close">关闭</el-button>
  </template>
  
  <script>
  import { reactive } from 'vue'
  import crumbs from '../../user management/crumb/crumb.vue'
  import {useStore} from 'vuex'
  import {useRouter,useRoute} from 'vue-router'

import axios from 'axios'
  export default {
     name: "reset",
     components:{
        crumbs,   
    },
     setup(){
    const store=useStore();
    const router=useRouter();
    const route=useRoute();
    const formInline = reactive({
      username: '',
      password: '',
      password2: '',
      phone:'',
  })
  
  const onSubmit = () => {
    console.log('submit!')
  }
  const confirm=()=>{
    router.push('/account')
           axios({
             url:"http://172.16.123.99:8080/enterprise/updateEnterpriserPwd",
             method:"post",
             params:{
                password:formInline.password,
                phone:formInline.phone,
                username:formInline.username,
                password2:formInline.password2,
                username:formInline.username,
                id:route.query.id,
             }
           }).then(resp=>{
                console.log(resp.data)
           })  
  }
  const close = () => {
        router.push('/account')
    }
    return {
        onSubmit,
        formInline,
        close,
        store,
        router,
        confirm,
        route
  }
  }
  
   }
  </script>
    <style scoped>
    .crumbs{
   margin-bottom:20px;
  }
  </style>
   
  